package com.tjetc.mapper;

import com.tjetc.domain.Newborn;
import com.tjetc.domain.Parent;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NewbornMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Newborn record);

    int insertSelective(Newborn record);

    Newborn selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Newborn record);

    int updateByPrimaryKey(Newborn record);

    @Select("select * from newborn where name=#{name} and parent_id=#{parentId}")
    Newborn findByNameAPId(@Param("name") String name,@Param("parentId") Integer parentId);

    @Select("select * from newborn")
    List<Newborn> list();

    @Select("select *from newborn where name LIKE CONCAT('%',#{x},'%')")
    List<Newborn> selBN(String x);

    @Select("select * from newborn where name=#{name}")
    Newborn findByName(String name);

    @Select("SELECT * FROM newborn WHERE parent_id = #{parentId}")
    List<Newborn> selectNewbornByParentId(int parentId);

    @Select("select * from newborn where parent_id=#{parentId}")
    List<Newborn> list1(int parentId);

    @Select("select * from newborn where parent_id=#{parentId}")
    List<Newborn> selBP(int parentId);

    int countNewbornByDoctorId(int id);

}